import { BrowserRouter, Routes, Route,Navigate,useRoutes } from 'react-router'
import React from 'react'

const Login = React.lazy(()=>import('../pages/Login'))
const Home = React.lazy(()=>import('../pages/home'))

const routes = [
    {
        path:'/login',
        element:<Login />   
    },
    {
        path:'/home',
        element:<Home />
    }
]


function WrapperRoutes(){
let ele = useRoutes(routes)
return ele
}
export default function WrapperRouter(){
    return(
        <BrowserRouter>
        <WrapperRoutes/>
        </BrowserRouter>
    )
}